home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS26.ADF / SoundScape / Include / soundscape.h < prev    next >
C/C++ Source or Header  |  1989-01-26  |  5KB  |  126 lines

  1. /*      SoundScape.H 
  2.  
  3.         (c) 1986 Todor Fay 
  4.  
  5.         Definitions and structure declarations for SoundScape. 
  6. */ 
  7.  
  8. struct Link { 
  9.         struct Link *next;         /* Next node in the linked list. */ 
  10.         unsigned char type;        /* Type of this node. */ 
  11.         unsigned char mark; 
  12.         unsigned short data; 
  13. }; 
  14.  
  15. struct Note { 
  16.         struct Link link; 
  17.         unsigned short duration;    /* Clock beats the note is on. */ 
  18.         unsigned short wait;        /* Clock beats till next note. */ 
  19.         unsigned char status;       /* Midi status. */ 
  20.         unsigned char value;        /* Note value. */ 
  21.         unsigned char velocity; 
  22. }; 
  23.  
  24. struct Seq { 
  25.         struct Link link; 
  26.         struct Note *note;          /* Pointer to a string of notes. */ 
  27.         unsigned short wait;        /* Clock beats till next note. */ 
  28.         char transpose;             /* Transpose value. */ 
  29.         char usetrans;              /* Use this tranposition. */ 
  30. }; 
  31.  
  32. #define NAMESIZE        12 
  33.  
  34. struct Track { 
  35.         struct Link link; 
  36.         struct Seq *startseq;       /* First sequence node. */ 
  37.         struct Seq *seq;            /* Pointer to sequence being processed. */ 
  38.         struct Note *startnote;     /* First note in sequence. */ 
  39.         struct Note *note;          /* Next note to play. */         
  40.         struct Note *lastnote;      /* Last note played. */ 
  41.         struct Note *noteon;        /* Oldest note still on. */ 
  42.         struct Note *rnote;         /* Note list for recording. */ 
  43.         struct Note *rstartnote;    /* Note list for recording. */ 
  44.         unsigned long time;         /* Time last event was recorded. */ 
  45.         unsigned short wait;        /* Clock beats till next note. */ 
  46.         unsigned short rstartwait;  /* Initial wait when recording. */ 
  47.         unsigned short startwait;   /* Initial wait. */ 
  48.         short mode;                 /* Play/Mute/Through, etc. */ 
  49.         short statusin;             /* Status types to allow in. */ 
  50.         short statusout;            /* Status types to allow out. */ 
  51.         char name[NAMESIZE];        /* Track gets a name! */ 
  52.         unsigned char portin;       /* Midi port to listen to. */ 
  53.         unsigned char portout;      /* Midi port to send to. */ 
  54.         char channelin;             /* Midi channel to record from. */ 
  55.         char channelout;            /* Midi channel to play on. */ 
  56.         char transpose;             /* Transpose value. */ 
  57. }; 
  58.  
  59. struct Ports {
  60.     struct Link link;        /* Yest another linked list. */
  61.     unsigned char port;        /* The index of the port to send to. */
  62. };
  63.  
  64. struct Port {
  65.     struct Ports *portsout;        /* Ports to send to. */
  66.     char *name;            /* Name of this port. */
  67.     long (*outcode)();        /* Routine to output a note. */
  68.     long (*editcode)();        /* Routine to allow editing. */
  69.     long (*closecode)();        /* Routine to close port. */
  70.     long (*opencode)();        /* Routine to open port. */
  71.     char countin;            /* # of ports sending here. */
  72.     char doin;            /* Active for input flag. */
  73.     char doout;            /* Active for output flag. */
  74.     char show;            /* Voodoo magic. */
  75. };
  76.  
  77. /*        Node types. */ 
  78.  
  79. #define NOTE       1 
  80. #define SEQ        2 
  81. #define TRACK      3 
  82.  
  83. /*         Track Mode Types. */ 
  84.  
  85. #define T_REC          1        /* Allow recording. */ 
  86. #define T_PLAY         2        /* Playback. */ 
  87. #define T_MUTE         4        /* Don't do anything. */ 
  88. #define T_THRU         8        /* Pass note info on (while recording). */ 
  89. #define T_TRANS        0x10     /* Allow transpositions. */ 
  90. #define T_MATCH        0x20     /* This track is in match mode. */ 
  91. #define T_1PLAY        0x40     /* One play mode, delete when done. */ 
  92. #define T_ECHO         0x80     /* Use this as an echo template. */ 
  93. #define T_CAUSETRANS   0x100    /* Cause transpositions. */ 
  94. #define T_TRIGGER      0x200    /* Wait for a specific event, then play. */ 
  95.  
  96. /*        Midi Commands */ 
  97.  
  98. #define NOTEOFF             0x80 
  99. #define NOTEON              0x90 
  100. #define POLYPRESSURE        0xA0 
  101. #define CONTROLCHANGE       0xB0 
  102. #define PROGRAMCHANGE       0xC0 
  103. #define AFTERTOUCH          0xD0 
  104. #define PITCHWHEEL          0xE0 
  105. #define SYSTEMX             0xF0 
  106. #define SONGPOSITION        0xF2 
  107. #define SONGSELECT          0xF3 
  108. #define TUNE                0xF6 
  109. #define EOX                 0xF7 
  110. #define CLOCK               0xF8 
  111. #define PUNCHIN             0xF9
  112. #define START               0xFA 
  113. #define CONTINUE            0xFB 
  114. #define STOP                0xFC 
  115. #define PUNCHOUT            0xFD
  116. #define ACTIVESENSE         0xFE 
  117.  
  118. /*        Edit commands */ 
  119.  
  120. #define USEREDIT        1 
  121. #define GETSTATE        2 
  122. #define SETSTATE        3 
  123. #define LOADSTATE       4 
  124. #define SAVESTATE       5 
  125.  
  126.